package com.app.miwawa.api.esm.entity.customer;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.framework.common.api.entity.CommonEntityUUID;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 基本信息表
 * <p>描述: 客户资料</p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date 2016年1月23日 上午8:49:14
 * @version 1.0.2016
 */
@Entity @Table(name = "TB_ESM_CUSTOMER_INFO")
public class Customer extends CommonEntityUUID {

	/** serialVersionUID(long):. */
	private static final long serialVersionUID = -503951257936761562L;

	// 客户编号 (KH-2016010001)
	@Column(name = "code", length = 50, nullable = true)
	private String code;
	
	// 市场渠道
	@Column(name = "market", length = 15, nullable = true)
	private String market;
	
	// 信息来源
	@Column(name = "source", length = 15, nullable = true)
	private String source;
	
	// 顾问ID
	@Column(name = "user_id", length = 50, nullable = true)
	private String userid;
	
	// 顾问姓名
	@Column(name = "user_name", length = 50, nullable = true)
	private String username;
	
	// 介绍人ID（会员家长）
	@Column(name = "parent_id", length = 50, nullable = true)
	private String parentId;
	
	// 介绍人姓名（会员家长）
	@Column(name = "parent_name", length = 50, nullable = true)
	private String parentName;

	// 创建时间（加入时间）
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name = "create_date", nullable = true)
	private Date createDate;
	
	// 家长信息
	@Transient
	private List<Parents> parents;
	
	// 学员信息
	@Transient
	private List<Student> student;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMarket() {
		return market;
	}

	public void setMarket(String market) {
		this.market = market;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getUserid() {
		return userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getParentName() {
		return parentName;
	}

	public void setParentName(String parentName) {
		this.parentName = parentName;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public List<Parents> getParents() {
		return parents;
	}

	public void setParents(List<Parents> parents) {
		this.parents = parents;
	}

	public List<Student> getStudent() {
		return student;
	}

	public void setStudent(List<Student> student) {
		this.student = student;
	}
}
